/*
 * @Author: moonwater 13812995013@163.com
 * @Date: 2025-02-27 09:35:33
 * @LastEditors: moonwater 13812995013@163.com
 * @LastEditTime: 2025-03-03 09:30:28
 * @FilePath: \???22Git???\day04\Test04.java
 * @Description: ???????????,??????`customMade`, ??koroFileHeader?????? ????????: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */


import java.math.BigDecimal;

public class Test04 {
    public static void main(String[] args) {
        //?????2??????????1.1????????????
        //???
        double money = 2.0;
        //1.1?
        double price = 1.1;
        //????
        double change = money - price;
        //???????
        System.out.println("????:" + change);
        //???????????
        System.out.println("????:" + (money * 10 - price * 10) / 10);
        //BigDecimal - ??? ???????????????????? ?????????????????? ???????
        BigDecimal money1 = new BigDecimal("2.0");
        BigDecimal price1 = new BigDecimal("1.1");
        double change1 = money1.subtract(price1).doubleValue();
        System.out.println("????:" + change1);
    }
    
}
